package com.google.cloud.testing.android.lib;

import android.support.v4.app.FragmentActivity;

public abstract class AbstractCloudActivity extends FragmentActivity {

    /**
     * Hack! Any subclass will assign its instance to this field once resumed (activated).
     * Instrumentation tests use this to take screenshots of the currently active/foreground activity.
     */
    private static volatile AbstractCloudActivity currentMyTracksActivity;

    public static AbstractCloudActivity getCurrent() {
        return currentMyTracksActivity;
    }

    @Override
    protected void onResume() {
        super.onResume();
        currentMyTracksActivity = this;
    }
}
